package cn.tedu.spring.eg1;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

@Component
public class Product {


    @Value("电脑")
    private String productName;

    private double price;

    private int count;


    public void setProductName(String productName) {
        this.productName = productName;
    }

    @Value("5000.99")
    public void setPrice(double price) {
        this.price = price;
    }

    @Value("10")
    public void setCount(int count) {
        this.count = count;
    }

    @Override
    public String toString() {
        return "Product{" +
                "productName='" + productName + '\'' +
                ", price=" + price +
                ", count=" + count +
                '}';
    }
}
